home *** CD-ROM | disk | FTP | other *** search
/ PC Play 129 / pc play 129.iso / Demo / man2 / man2.exe / data / scripts / oldunits_neweffects / oldunits_neweffects_plazmaball_fly.lua < prev    next >
Encoding:
Text File  |  2006-02-27  |  2.2 KB  |  82 lines

  1.  
  2. function plazmaball_fly()
  3.     local explosion = uniGetExecutor()
  4.     explosion:setTransformOwner()
  5.     local mshot1 = explosion:addSimpleEffect(ENET_EFFECT_PS_NEWPLAZMABALL)
  6.     local light = explosion:addSimpleEffect(ENET_EFFECT_NEWPLAZMABALL_LIGHTSPOT)
  7.     waitDeath(explosion:parabolicFly(uniGetTarget()))
  8.     mshot1:suspendedDestroy(5.0)
  9.     local exp_ps = explosion:addSimpleEffect(ENET_EFFECT_PS_NEWPLAZMABALLEXPLOSION)
  10.     uniGetTarget():executeCommand(ENC_DAMAGED)
  11.     pause(1.0)
  12.     exp_ps:suspendedDestroy(5.0)
  13.     light:destroy()
  14.     pause(3.0)
  15.     explosion:destroy()
  16. end
  17.  
  18. registerCommand(ENSCRIPTSET_NEWPLAZMABALL,ENC_FIRE1,"plazmaball_fly")
  19.  
  20. --
  21. -- dummy effect creation test
  22. --
  23. desc = getEffectDescriptionP(ENET_EFFECT_PS_NEWPLAZMABALL_FLY)
  24. desc.ClassID = ENCLASS_DUMMY
  25. desc.EffectClassType = ENECT_GEOMETRY
  26.  
  27. desc.ScriptSet = ENSCRIPTSET_NEWPLAZMABALL
  28. desc.RelativePosition = ENLOCALPOS_NOTSPECIFIED
  29. local vzbzd1 = D3DXVECTOR3:new(0,0,0)
  30. desc.LocalPosition = vzbzd1
  31. vzbzd1:delete()
  32. desc.MoveType = ENMOVE_FLY
  33.  
  34. desc.ActivityType = ENACT_COMMANDSEMIACTIVE
  35. --
  36. -- end dummy effect creation test
  37. --
  38.  
  39.  
  40.  
  41. --
  42. -- lightsource creation test
  43. --
  44. desc = getEffectDescriptionP(ENET_EFFECT_NEWPLAZMABALL_LIGHTSPOT)
  45. desc.ClassID = ENCLASS_LIGHTSOURCE
  46. desc.EffectClassType = ENECT_LIGHTSOURCE
  47.  
  48. desc.ScriptSet = ENSCRIPTSET_UNKNOWN
  49. desc.RelativePosition = ENLOCALPOS_NOTSPECIFIED
  50. local vzbzd2 = D3DXVECTOR3:new(0,0,0)
  51. desc.LocalPosition = vzbzd2
  52. vzbzd2:delete()
  53. desc.ActivityType = ENACT_SEMIACTIVE
  54.  
  55. -- add interpolators
  56. desc:clearInterpolators()
  57.  
  58. local interpolator = createInterpolator()
  59. interpolator:addKey(0.0,70.0)
  60. interpolator:addKey(1.0,70.0)
  61. interpolator:finalize(false)
  62. -- add interpolator on light range
  63. desc:addInterpolator(interpolator,getFieldOffset(EN_FIELD_LIGHT_RANGE))
  64.  
  65. local interpolator = createInterpolator()
  66. interpolator:addKey(0.0,0.1)
  67. interpolator:addKey(1.0,0.1)
  68. interpolator:finalize(false)
  69. -- add interpolator on R B colors
  70. desc:addInterpolator(interpolator,getFieldOffset(EN_FIELD_DIFFUSE_R))
  71. desc:addInterpolator(interpolator,getFieldOffset(EN_FIELD_DIFFUSE_B))
  72. desc:addInterpolator(interpolator,getFieldOffset(EN_FIELD_DIFFUSE_G))
  73.  
  74.  
  75. --
  76. -- end lightsource creation description
  77. --
  78.  
  79.  
  80.  
  81.  
  82.